Skip to main content
Plugins / Node PM

Node PM

by Woodpecker Authors

Execute NPM, PNPM, Yarn or Bun scripts


plugin-node-pm

Woodpecker plugin to install Node.js® dependencies and execute NPM, PNPM, Yarn or Bun scripts.

Features

  • Automatically find used package manager (based on lockfile)
  • Install dependencies, if node_modules don't exist
  • Run multiple tasks

Settings

Settings Name Default Description
run none Script name or YAML list of multiple script names to run (see scripts property in package.json)
with autodetect, fallback to npm Enforce to use either npm, yarn, pnpm or bun as the package manager
frozen_lockfile false If set to true (recommended): fails if lockfile is invalid, missing or outdated
ignore_node_modules false If set to true (recommended): run dependencies install even with existing node_modules directory

Examples

Workflow running one script:

pipeline:
  build:
    image: codeberg.org/woodpecker-plugins/node-pm
    settings:
      run: build # script name
      with: pnpm # if `with` is set, enforce to use this package manager
      frozen_lockfile: true # recommended
      ignore_node_modules: true # recommended

Workflow running multiple scripts (prepare and build):

pipeline:
  build:
    image: codeberg.org/woodpecker-plugins/node-pm
    settings:
      run:
        - prepare
        - build